% Function:
%   plot horizontal line for specified y
% Argument:
%   y: specified y value
%   s: line specific
% Return:
%   ln: Line handle
function ln = hline(y)
    % check arguments
    if nargin == 1
        s = 'k--';
    end

    % plot without cleaning
    hold on;

    % if x is column vector, transform it to row vector
    if iscolumn(y)
        y = y';
    end

    x = xlim;
    y = repmat(y, 2, 1);

    ln = plot(x, y, s);
end
